package ru.nagakhl.whirlpool;

import org.apache.cassandra.thrift.Cassandra;

/**
 * Interface of some kind of proxy class, used by connection to interact with connection 
 * manager it is created by.
 * 
 * @author nagakhl
 *
 */
public interface ManagerConnector {
	
	/**
	 * Inform manager that connection can be returned to connection pool
	 * 
	 * @param client Cassandra client to return to pool
	 */
	public void releaseClient(Cassandra.Client client);
	
	/**
	 * Notify manager that some exception occurred during work.
	 * 
	 * @param ex Exception that occured
	 */
	public void notifyFailure(Exception ex);
	
	/**
	 * Get class mapping metadata, such as column/supercolumn name, keyspace etc.
	 * 
	 * @param cls Class to retrieve metadata about
	 * @return Metadata object wrapping info about class mappings
	 */
	public Metadata getMetadata(Class<?> cls);
	
}
